home *** CD-ROM | disk | FTP | other *** search
- Subject: Union of Adjacent ODShapes
- Sent: 6/25/96 8:04 PM
- Received: 7/1/96 8:35 AM
- From: Serge Froment, sfroment@odyssee.net
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- Dear ODF and OpenDoc Teams:
-
- I create an ODShape, set it as a rect and Union three adjacent rect to it,
- and return it as the result of CMySelection::CreateSelectionShape. The
- resulting drag outline, instead of one large rectangle, is made of four
- small adjacent outlines.
-
- Here is my code:
-
- ODShape* CCalendarShape::CreateSelectionShape(Environment* ev,
- FW_CGraphicContext& gc, const CDateCollection& selection) const
- {
- FW_CAcquiredODShape aqSelectionShape = ::FW_NewODShape(ev);
- FW_CAcquiredODShape aqTempShape = ::FW_NewODShape(ev);
- FW_Boolean first = true;
-
- CDateCollectionIterator iter(selection, fMonth);
- for (CDate date = iter.First(); iter.IsNotComplete(); date =
- iter.Next())
- {
- FW_CRect dayCell = this->GetDateRect(gc, date);
- if (first)
- {
- aqSelectionShape->SetRectangle(ev, (ODRect*) &dayCell);
- first = false;
- }
- else
- {
- aqTempShape->SetRectangle(ev, (ODRect*) &dayCell);
- aqSelectionShape->Union(ev, aqTempShape);
- }
- }
-
- aqSelectionShape->Acquire(ev);
- return aqSelectionShape;
- }
-
- The successive values of dayCell (left, top, right, bottom) are:
-
- 18, 69, 31, 80
- 31, 69, 44, 80
- 44, 69, 57, 80
- 57, 69, 70, 80
-
- Is this a bug?
-
- Serge
-
-